package com.sky.wsp.dm.controller;

import com.sky.wsp.dm.dao.MyTestEntity;
import com.sky.wsp.dm.dao.MyTestMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangshaopeng@talkweb.com.cn
 * @desccription 在此输入描述
 * @date 2023/7/25
 */
@RestController
public class TestController {

    @Resource
    private MyTestMapper myTestMapper;

    @GetMapping("index")
    public String index(long id) {
//        MyTestEntity query = new MyTestEntity();
//        List<MyTestEntity> list = myTestMapper.findList(query);
//        for (MyTestEntity e : list) {
//            System.out.println(e.getId() + " ==> " + e.getName());
//        }
        MyTestEntity myTestEntity = myTestMapper.myFindById(id);
//        MyTestEntity myTestEntity = myTestMapper.selectById(id);
        if (null != myTestEntity) {
            return myTestEntity.getName() + " == " + myTestEntity.getChecked();
        }
        return "id " + id + " not found!";
    }
}
